<style>
    .a_bg{background: #c1272d;}
    .a_banner{height:270px;width:1200px;overflow:hidden;}
    .a_guize{background:#fff;padding:20px;}
    .a_guizetext{text-align: center;border-bottom:1px solid #ddd;line-height: 30px;padding-bottom: 20px;}
    .a_tips{line-height: 38px;margin-left:240px;}
    .a_tips2{line-height: 38px;margin-left:240px;}
    .urls{margin-left:10px;height:36px;border:1px solid #ccc;padding:0px 10px;line-height:36px;width:500px;}
    .a_tenpic{background:#f7931e;padding:15px;}
    .a_banner2{width:522px;margin:0px auto;text-align:center;}
    .a_ten_p_box{width:970px;height:80px;overflow:hidden;position: relative;background:url(<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/10r_bg.png) no-repeat 0px 0px;margin:20px auto;}
    .a_ten_p_cover{top:0px;left:0px;height:80px;overflow:hidden;position: absolute;background:url(<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/10r_cover.png) no-repeat 0px 0px;}
    .a_list{width:1172px}
    .a_list li{width:290px;float:left;margin-right:3px;margin-bottom:10px;}
    .a_list li .img{width:290px;height:190px;overflow:hidden;position:relative;}
    .a_list li .img .a_shadow{position:absolute;bottom:0px;left:0px;background:#000;opacity:0.7;filter:alpha(opacity=70);width:270px;padding:0px 10px;color:#fff;height:26px;line-height:26px;z-index:10;}
    .a_list li .img .a_shadow_txt{position:absolute;bottom:0px;left:0px;width:270px;padding:0px 10px;color:#fff;height:26px;line-height:26px;z-index:13;}
    .a_list li .img img{width:100%;}
    .a_list li .img i{font-style: normal;text-decoration: line-through;}
    .a_list li .btns{background:#fff;padding:10px 70px;}
    .a_list li .btns a{text-align:center;}
    .a_product_list{width:1170px;overflow:hidden;position:relative;}
    .a_product_list .a_cover{position:absolute;top:0px;left:0px;width:1170px;height:420px;background:#000;opacity:0.5;filter:alpha(opacity=50);}
    .a_product_list .a_lock{width:172px;height:172px;background:url(<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/lock.png) 0px 0px no-repeat;position:absolute;left:499px;top:125px;}
    .hb_box{height:420px;}
    .hb_close{width:360px;height:267px;background:url(<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/hb_close.png) 0px 0px no-repeat;overflow:hidden;position:absolute;left:405px;top:80px}
    .hb_open{width:300px;height:349px;background:url(<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/hb_open.png) 0px 0px no-repeat;overflow:hidden;position:absolute;left:435px;top:35px}
</style>
<div class="a_bg">
    <div class="wp">
        <div class="a_banner"><img src="<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/banner1.png"/></div>
        <div class="a_guize">
            <div class="a_guizetext">
                <div class="f_16"><b>活动规则</b></div>
                <div class="f_16">注册用户转发下方链接至好友，成功邀请10位好友注册即可免费获取一份美味午餐</div>
                <div class="f_14 c_gray2">免费午餐每位用户限领一次<span class="pipe">/</span>仅已注册用户可发送邀请链接，已注册用户无法被邀请<span class="pipe">/</span>本次活动仅限于光谷、中南路、江汉路附近商圈</div>
            </div>
            <div class="cl tm10">
                <?php if (Yii::app()->user->isGuest): ?>
                    <div class="z a_tips f_14 c_gray">此活动需要灵动生活注册用户资格</div>
                    <a href="<?php echo Yii::app()->createUrl('site/login'); ?>" class="submit_green submit z">立即登录</a><a href="<?php echo Yii::app()->createUrl('site/register'); ?>" class="submit_green submit z lm15">注册新账号</a>
                <?php else: ?>
                    <div class="z a_tips2 f_14">你的邀请链接</div><div class="z urls f_14" id="myurl">http://www.ldfood.cn/register?pid=<?php echo Yii::app()->user->id; ?></div><a href="javascript:void(0);" class="copy-btns submit submit_green z lm15">复制链接</a>
                <?php endif; ?>
            </div>
        </div>
        <div class="tm10 a_tenpic">
            <div class="a_banner2"><img src="<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/a_bt1.png"/></div>
            <div class="a_banner2"><img src="<?php echo Yii::app()->baseUrl; ?>/images/activity/20140824/15.png"/></div>
            <div class="tm10 a_tenpeople">
                <div class="a_ten_p_box">
                    <div class="a_ten_p_cover" style="width:<?php echo ($count >= 10 ? 10 : $count) * 10; ?>%;"></div>
                </div>
            </div>
            <div class="a_product_list">
                <div class="hb_box">
                    <?php if($flag):?>
                    <a class="hb_close" id="hb-img" href="javascript:;" onclick="ajaxWindow('提示信息', 'addBuyerCoupons','account');"></a>
                    <?php else:?>
                    <a class="hb_open" id="hb-img" href="javascript:;"></a>
                    <?php endif;?>
                </div>
                <?php if ($count < 10): ?>
                    <div class="a_cover"></div>
                    <div class="a_lock"></div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
<SCRIPT>
    $(document).ready(function() {
        $(".copy-btns").click(function() {
            var Url = $("#myurl").text();
            copyToClipboard(Url);
        })
    });

    function copyToClipboard(maintext) {
        if (window.clipboardData) {
            window.clipboardData.setData("Text", maintext);
        } else if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                alert("该浏览器不支持一键复制！\n请手工复制文本框链接地址～");
            }
            var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
            if (!clip)
                return;
            var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (!trans)
                return;
            trans.addDataFlavor('text/unicode');
            var str = new Object();
            var len = new Object();
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            var copytext = maintext;
            str.data = copytext;
            trans.setTransferData("text/unicode", str, copytext.length * 2);
            var clipid = Components.interfaces.nsIClipboard;
            if (!clip)
                return false;
            clip.setData(trans, null, clipid.kGlobalClipboard);
        }
        alert("以下内容已经复制到剪贴板\n" + maintext);
    }
</SCRIPT>